<!DOCTYPE html>
<html>
<#include "/views/ftl/base/manager_include.ftl">
<script type="text/javascript" src="${basePath}js/My97DatePicker/WdatePicker.js"></script>
<base href="${basePath}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加营业员</title> 
</head>
<body style="background:#eef3f7;">
<#include "/views/ftl/base/head.ftl"> 
<div class="Main">
  <div class="dw">
<#include "/views/ftl/base/menu.ftl">
<#function a><#return "添加营业员_List"></#function> 
<!--右边内容-->
<div class="Rightbox fl">
    <!--导航-->
    <div class="Bread_crbs clear">
      <div class="Bread_crbs_img fl"></div>
      <div class="Bread_crbs_text fl">
      	<a href="javascript:void(0);"><span>营业员管理</span></a>
      	<span class="fnt_famy">></span>
      	<a href="javascript:void(0);"><span>添加营业员</span></a>
      </div>
    </div>
      <div class="Table">
        </div>
  <!--表格列表-->
        <div class="Table"> 
          
          <div class="input_name">
             <span class="left_title">工号：</span>
             <input type="text" name="jobNumber" class="search_text tdd50" style="width:210px" value=""> 
          </div>
          
         <div class="input_name">
             <span class="left_title">姓名：</span>
             <input type="text" name="clerkName" class="search_text tdd50" style="width:210px" value=""> 
		 </div>
		 
		 <div class="input_name">
             <span class="left_title">备注：</span>
             <input type="text" name="remark" class="search_text tdd50" style="width:210px" value="">
		 </div>
          
		<span class="tbl_btn" style="margin-left: 300px;"> 
        	<a href="javascript:void(0);"><span id="save" style="background: #0075c5;">保存</span></a>
        </span>

          
        </div>
</div> 
 
<script> 
$(function(){
	
	$("#save").click(function(){
		
		var jobNumber = $("input[name=jobNumber]").val(); 
		var clerkName = $("input[name=clerkName]").val();  
		var remark    = $("input[name=remark]").val();  
		
		
		if(jobNumber==''){
			alert("工号不能为空");
			return;
		}
		if(isNaN(jobNumber)){
			alert("请填写正确的数字工号");
			return;
		}
		
		if(clerkName==''){
			alert("姓名不能为空");
			return;
		}
		
		$.ajax({ 
			url : "${basePath}manager/ShopClerk_createShopClerk",
			data : { 
				jobNumber:jobNumber,
				clerkName:clerkName,
				remark:remark
			}, 
			dataType :"JSON",
			cache : false, 
			type : "POST",
			success : function(dat){
				if(dat.code==1){
					alert(dat.msg);
					window.location.href="${basePath}manager/ShopClerk_shopClerkInfo?shopClerkId="+dat.data.shopClerkId;
				}else{
					alert(dat.msg);	
				} 
			}
		});
	});

});

</script>
</body>
</html>

